<template>
  <el-form ref="form" label-position="right" class="j-attribute-set" size="mini" label-width="100px">
<!--     <el-form-item label="执行提示">
      <el-radio-group v-model="data.is_tips">
        <el-radio :label="true">开启</el-radio>
        <el-radio :label="false">关闭</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="提示信息" v-if="data.is_tips">
      <el-input v-model="data.tips" placeholder="请输入执行提示"></el-input>
    </el-form-item>
    <el-form-item label="操作类型">
      <el-radio-group v-model="data.is_type">
        <el-radio label="action">事件</el-radio>
        <el-radio label="directive">指令</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="执行事件" v-if="data.is_type=='action'">
      <el-select v-model="data.action" placeholder="选择绑定字段">
        <el-option :label="item.title" :value="item.name" v-for="(item,index) in actions" :key="index"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="执行指令" v-if="data.is_type=='directive'">
      <el-select v-model="data.directive" placeholder="选择指令">
        <el-option :label="item.title" :value="item.name" v-for="(item,index) in gather" :key="index"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="传递数据集" v-if="data.is_type=='directive'">
      <el-select v-model="data.gather" placeholder="选择数据集">
        <el-option :label="item.title" :value="item.name" v-for="(item,index) in gather" :key="index"></el-option>
      </el-select>
    </el-form-item> -->
  </el-form>
</template>
<script type="text/javascript">
import { mapState, mapMutations, bootstrap } from 'vuecx'
export default {
  props: {
    value: [Array, Object, Number, String]
  },
  data() {
    return {
      action: {
        is_tips: false,
        tips: "您确定执行该操作吗？",
        is_type: 'action',
        action: "",
        directive: "",
        gather: ""
      },
      fields: []
    };
  },
  computed: {
    // ...mapState(['main']),
    // actions: function(argument) {
    //   return this.main.libraries[2].attribute.actions;
    // },
    // gather: function(argument) {
    //   return this.main.libraries[1].attribute.models;
    // },
    // data: {
    //   get: function() {
    //     return this.value;
    //   },
    //   set: function(value) {
    //     this.$emit('input', value);
    //   }
    // }
  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {


  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {

  }

}

</script>
<style type="text/css" lang="scss">
.j-attribute-set {
  padding: 10px;
}

.el-form-item--mini.el-form-item,
.el-form-item--small.el-form-item {
  margin-bottom: 10px;
}

.el-form--label-top .el-form-item__label {
  float: none;
  display: inline-block;
  text-align: left;
  padding: 0;
}

</style>
